import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { User } from '../entities/User.entity';
import { In, Repository, Transaction, TransactionManager } from 'typeorm';
import { Logger } from '../common/logger/logger';
 
import { UserMapper } from '../mapper/UserMapper';
import { PageDto } from '../common/dto/page.dto';
import { UserDto } from '../common/dto/user-dto';



@Injectable()
export class MysqlDemoService {
  constructor(
    @InjectRepository(User)
    private readonly userRoleRepository: Repository<User>,
  ) {}
  async findAll(): Promise<PageDto<User>> {
    const items = await this.userRoleRepository.find();
    const count = this.userRoleRepository.count();
    // Logger.info(items)
    return new PageDto(items, {pageNum:1,pageSize:1,total:1});
  }
}
